package main

import (
	"game-server/conf"
	"game-server/game"
	"github.com/name5566/leaf"
	lconf "github.com/name5566/leaf/conf"

	"game-server/db"
	"game-server/gate"
	"game-server/login"
	"game-server/chat"
)

func main() {
	lconf.LogLevel = conf.Server.LogLevel
	lconf.LogPath = conf.Server.LogPath
	lconf.LogFlag = conf.LogFlag
	lconf.ConsolePort = conf.Server.ConsolePort
	lconf.ProfilePath = conf.Server.ProfilePath

	//defer func() {
	//	if r := recover(); r != nil {
	//		//var ok bool
	//		//err, ok = r.(error)
	//		//if !ok {
	//		//	err = fmt.Errorf("pkg: %v", r)
	//		//}
	//		fmt.Print(r)
	//	}
	//}()

	leaf.Run(
		game.Module,
		chat.Module,
		gate.Module,
		db.Module,
		login.Module,
	)
}
